<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>个人页面</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="/js/plugins/bootstrap-4.1.1-dist/css/bootstrap.min.css">
    <script src="/js/plugins/jquery/jquery.min.js"></script>
    <script src="/js/plugins/bootstrap-4.1.1-dist/js/bootstrap.min.js"></script>
    <script src="/js/plugins/jrender/jrender.min.js"></script>
    <link rel="stylesheet" href="/css/font/css/font-awesome.min.css">
    <link rel="stylesheet" href="/css/reset.css">
    <link rel="stylesheet" href="/css/userProfiles.css">
    <script src="/js/common.js"></script>
    <link rel="stylesheet" href="/js/plugins/dialog2/dialog.css">
    <script src="/js/plugins/dialog2/dialog.js"></script>
</head>
<script>
    $(function () {
        //获取当前登录的用户信息
        var user = JSON.parse(sessionStorage.getItem("user"));
        //把用户信息渲染到页面中
        $(".info").renderValues(user);
        //设置背景图回显
        $(".bg").css("background-image", 'url("' + user.coverImgUrl + '")');
        //获取所有收藏的游记
        $.get('/collects/' + user.id + '/travels', {currentPage: 1, pageSize: 8}, function (data) {
            $("#travels").renderValues(data);
            //给a链接绑定事件
            $(".travels a[data-url]").click(function () {
                var url = $(this).data('url');
                var id = $(this).data('tid');
                window.location.href = url + id;
            })
        })
        //获取所有收藏的日报
        $.get('/collects/' + user.id + '/news', {currentPage: 1, pageSize: 8}, function (data) {
            $("#news").renderValues(data);
            //给a链接绑定事件
            $(".news a[data-url]").click(function () {
                var url = $(this).data('url');
                var id = $(this).data('nid');
                window.location.href = url + id;
            })
        })
    })
</script>
<body>
<div class="container bg" style="background-image: url(&quot;/img/user/bg.jpeg&quot;);">
    <a href="javascript:window.history.go(-1)" class="my-arrow">
        <span><i class="fa fa-chevron-left fa-2x"></i></span>
    </a>
    <div class="container">
        <div class="info">
            <img class="rounded-circle" width="17%" render-src="headImgUrl">
            <p class="name" render-html="nickName"></p>
            <p render-html="sign"></p>

            <div class="row num">
                <div class="col-2 border border-left-0 border-top-0 border-bottom-0">
                    <div>
                        <span render-html="followNum"></span>
                    </div>
                    <div>
                        <span>关注</span>
                    </div>
                </div>
                <div class="col-2">
                    <div>
                        <span render-html="fanNum"></span>
                    </div>
                    <div>
                        <span>粉丝</span>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<input type="hidden" name="currentPage" id="currentPage" value="1">
<input type="hidden" name="pageSize" id="pageSize" value="3">
<div class="tabs">
    <ul class="nav nav-pills nav-justified  border border-left-0 border-top-0 border-right-0" id="pills-tab"
        role="tablist">
        <li class="nav-item">
            <a class="nav-link active" id="travels-tab" data-toggle="pill" href="#travels">
                我收藏的游记
            </a>
        </li>
        <li class="nav-item">
            <a class="nav-link " id="comments-tab" data-toggle="pill" href="#comments">
                我收藏的点评
            </a>
        </li>
        <li class="nav-item">
            <a class="nav-link" id="pills-contact-tab" data-toggle="pill" href="#pills-contact">
                我收藏的日报
            </a>
        </li>
    </ul>
    <div class="container tab-content" id="pills-tabContent">
        <div class="tab-pane fade show active" id="travels">
            <dl class="list">
                <dd class="travels" render-loop="list">
                    <a href="javascript:;" data-url="/travelContent.html?id=" render-attr="data-tid=list.travel.id">
                        <img render-src="list.travel.coverUrl">
                        <p><span class="title" render-html="list.travel.title"></span>
                            <span class="span-right">
						 				<span>0</span> <i class="fa fa-thumbs-o-up"></i></span>
                        </p>
                    </a>
                </dd>
            </dl>
        </div>
        <div class="comment tab-pane fade " id="comments">
            <input type="hidden" name="currentPage" value="1">
            <input type="hidden" name="pageSize" value="5">
            <input type="hidden" name="rows" value="1">
            <div>
                <div class="row">
                    <div class="col-2 comment-head">
                        <img class="rounded-circle" src="/upload/7e854d1d-a7be-4360-8943-8771d18ee0e3.jpg">
                    </div>
                    <div class="col">
                        <span class="comment-star"><i class="fa fa-star"></i><i class="fa fa-star"></i><i
                                class="fa fa-star"></i><i class="fa fa-star-o"></i><i class="fa fa-star-o"></i></span>

                        <span class="comment-date">2018-07-11</span>
                        <div class="comment-content">
                            <a href="strategyComment.html" data-id="4">
                                <p>骑了个单车到沙面，春风把从上下九和宝华路带来的燥热吹散。沙面临江，下午的时光让这富有异国风情的公园显得更加宁静惬意，哪怕...</p>
                            </a>
                        </div>
                        <ul class="comment-img">
                            <li>
                                <img src="/upload/63bb765d-5dff-44f8-b7f1-cb338b9b9f95.jpeg">
                            </li>
                            <li>
                                <img src="/upload/7d437f8d-a476-465c-bd84-e93a03d8efd5.jpeg">
                            </li>
                        </ul>

                        <div class="comment-link">
                            <a href="strategyCatalogs.html" data-id="2">
                                <img src="/upload/e5e8a1a7-b127-4145-9fd0-a94e29f752ba.jpeg"> <span>广州攻略</span>
                                <i class="fa fa-angle-right fa-2x"></i>
                            </a>
                        </div>

                    </div>
                </div>
            </div>
        </div>
        <div class="tab-pane fade" id="pills-contact">
            <div class="tab-pane fade show" id="news">
                <dl class="list">
                    <dd class="news" render-loop="list">
                        <a href="javascript:;" data-url="/newsContent.html?id=" render-attr="data-nid=list.news.id">
                            <img render-src="list.news.coverUrl">
                            <p><span class="title" render-html="list.news.title"></span>
                                <span class="span-right">
						 				<span>0</span> <i class="fa fa-thumbs-o-up"></i></span>
                            </p>
                        </a>
                        <hr>
                    </dd>
                </dl>
            </div>
        </div>
    </div>
</div>


</body>
</html>